<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			#div1{
				width: 200px;
				height: 200px;
				background: red;
			}
		</style>
	</head>
	<body>
		<script>
			function getStyle(obj,name,value){
				if(arguments.length==2){
					return arguments[0].style[arguments[1]]
				}else if(arguments.length==3){
					arguments[0].style[arguments[1]]=arguments[2];
				}else{
					alert("no");
				}
			}
			window.onload=function(){
				var div1=document.getElementById("div1");
				getStyle(div1,'backgroundColor','green');
				alert(getStyle(div1,'width'));
			}
		</script>
		<div id="div1"></div>
	</body>
</html>
